package com.tywj.panda.customer.common.constant


/**
 * @desc 全局状态码和描述
 * @author June Yang
 * @date 2018/6/11
 */
object GlobalCode {

    //0 待付款 1付款 2已退款 3已取消 4已过期 5支付失败 6锁定（预留）7 已完成（预留） 99未知（预留）
    const val ORDER_STATUS_ALL = 0
    const val ORDER_STATUS_MADE_PAYMENT = 1
    const val ORDER_STATUS_REFUND = 2
    const val ORDER_STATUS_CANCELED = 3
    const val ORDER_STATUS_EXPIRED = 4
    const val ORDER_STATUS_PAY_FAILED = 5
    const val ORDER_STATUS_COMPLETED = 7

    fun getOrderStatus(orderStatus: Int): String {
        when (orderStatus) {
            ORDER_STATUS_ALL -> {
                return "待付款"
            }
            ORDER_STATUS_MADE_PAYMENT -> {
                return "已付款"
            }
            ORDER_STATUS_REFUND -> {
                return "已退款"
            }
            ORDER_STATUS_CANCELED -> {
                return "已取消"
            }
            ORDER_STATUS_EXPIRED -> {
                return "已过期"
            }
            ORDER_STATUS_PAY_FAILED -> {
                return "支付失败"
            }
            ORDER_STATUS_COMPLETED -> {
                return "已完成"
            }
            else -> {
                return "未定义"
            }
        }
    }

}